import Vue from 'vue'
const Download = function (fileUuid, fileName) {
  const data = {
    'fileUuid': fileUuid,
    'th': 1
  }
  if (fileName) {
    data['downloadName'] = fileName
  }
  Vue.prototype.$axios({
    method: 'post',
    url: `${Vue.prototype.$site.oaServer}/common/fileDownloadUrl.htm`,
    data: Vue.prototype.$qs.stringify(data)
  }).then(res => {
    // 成功回调
    const elemIF = document.createElement('iframe')
    elemIF.src = res.data
    elemIF.style.display = 'none'
    document.body.appendChild(elemIF)
    setTimeout(() => {
      document.body.removeChild(elemIF)
    }, 300)
  })
}
export default Download
